AEGetNthDesc
AEGetNthDesc Get descriptor record from a descriptor list
#include <AppleEvents.h> Apple Event Manager
OSErr AEGetNthDesc( theAEDescList, index, desiredType,
theAEKeyword, result );
AEDescList * theAEDescList ; descriptor list to be counted
long index ; position of descriptor record in list
DescType desiredType ; descriptor type
AEKeyword * theAEKeyword ; Apple Event keyword
AEDesc * result ; Desired descriptor record
returns Error Code; 0 = no error
You can use the AEGetNthDesc function to get a descriptor record from any
descriptor list.
The AEGetNthDesc function returs a specified descriptor record from a
specified descriptor list. Your application should call the AEDisposeDesc
function to dispose of the resulting descriptor record after your application
has finished using it.
If AEGetNthDesc returns a nonzero result code, it returns a descriptor
record of descriptor type typeNull. A descriptor record of this type does not
contain any data.
The parameter theAEDescList is the descriptor list from which to get the
descriptor record.
The index parameter is the position of the descriptor record to get (for
example, 2 specifies the second descriptor record in the list).
The desiredType parameter is the descriptor type of the resulting data; if the
descriptor record is not of this type, the Apple Event Manager attempts to
coerce it into this type. If the value of desiredType is typeWildCard, no
coercion is performed, and the descriptor type of the resulting descriptor
record is the same as the descriptor type of the original descriptor record.
If you are getting data from a list of keyword-specified descriptor records,
the AEGetNthDesc function returns the keyword of the specified
descriptor record in the parameter theAEKeyword; otherwise,
AEGetNthDesc returns the typeWildCard constant.
The AEGetNthDesc function returns in the result parameter the resulting
descriptor record. This function creates a new descriptor record by copying
the descriptor record from the parameter. Your application is responsible for
using the AEDisposeDesc function to dispose of the resulting
descriptor record once you are finished using it.
If the function returns a nonzero result code, a descriptor record with the
typeNull descriptor type is returned. A descriptor record of this type does not
contain any data.
Result codes
noErr (0) No error
memFullErr (-108) Not enough room in heap zone
errAECoercionFail (-1700) Data could not be coerced to descriptor type
errAEDescNotFound (-1701) Descriptor record was not found
errAENotAEDesc (-1704) Not a valid descriptor record
errAEReplyNotArrived (-1718) Reply has not yet arrived